const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('company_info', {
    id: {
      type: DataTypes.STRING(40),
      allowNull: false,
      primaryKey: true
    },
    name: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "公司名字"
    },
    info: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "公司简介"
    },
    moneyTotal: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "企业资产总额"
    },
    income: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "企业营业收入"
    },
    taxRevenue: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "纳税总额"
    },
    cost: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "企业营业成本"
    },
    personTotal: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "企业成员数量"
    },
    debt: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "企业负债总额"
    },
    profit: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "营业利润"
    },
    location: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "地理位置"
    },
    year: {
      type: DataTypes.BIGINT,
      allowNull: true
    }
  }, {
    sequelize,
    tableName: 'company_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
